package daily

class PersonPortraitTagLib {
    def showPortrait = { attrs, body ->
        def width = 50,height = 50
        if (attrs.width == null &&  "true".equals(attrs.mini) ) {
            width = 20
            height = 20
        }

        if (attrs.width != null && !attrs.height!= null ) {
            width = attrs.width
            height = attrs.height
        }

        def url = request.contextPath  +  "/person/viewCurrentPersonsPortrait"

        out << '<img src="' + url + '" height="'+ height +'" width="'+ width +'"/>'
    }


}
